const { defineConfig } = require("@vue/cli-service")

let projectName = process.argv[3]

module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: "./",
  outputDir: `./dist/${projectName}`,
  pages: {
    index: {
      entry: `./src/views/${projectName}/index.js`,
      //指定模板
      template: "./public/index.html",
      //动态设置模板id
      templateID: projectName,
    },
  },
})

function getEntry() {
  let entry = {}
  entry = {
    index: {
      //指定入口文件
      entry: "./src/views/" + projectName + "/index.js",
      //指定模板
      template: "./public/index.html",
      //动态设置模板id
      templateID: projectName,
    },
  }

  return entry
}

// let pages = getEntry()
// console.log(path.resolve(__dirname, "./src/views/" + projectName + "/index.js"))
// console.log(entryPathConfig)

//vue.config.js配置
// module.exports = defineConfig({
//   transpileDependencies: true,
//   publicPath: "./",
//   outputDir: "./dist/" + projectName,
//   pages: pages,
// })
